﻿Public Class WfStatDesp
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim objDespdao As New DespachateDAO
        Dim lista As New List(Of Despachante)
        lista = objDespdao.ListaTodos()

        If IsPostBack = False Then
            For Each Desp As Despachante In lista
                DropDesp.Items.Add(Desp.FantasiaDesp)
            Next
        End If

    End Sub

    Protected Sub BtnAltDesp_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BtnAltDesp.Click
        Dim nome_desp As String
        nome_desp = DropDesp.SelectedValue.ToString
        Response.Redirect("WfAltDesp.aspx?NomeDesp=" & nome_desp & "")

    End Sub

    Private Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
        If Session("AdmLogado") Is Nothing Then
            Response.Redirect("/Screens/WF1.aspx")
        End If
    End Sub
End Class